package com.bjx.system.domain.vo;


import com.bjx.common.core.domain.group.Update;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;

/**
 * @desc: 菜单实体
 * @author: liushuai
 * @date: 2022/7/6 13:54
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
@Schema(title = "MenuVO",description = "菜单视图")
public class MenuVO  {

    /**
     * 菜单ID
     */
    @NotNull(groups = Update.class)
    @Schema(title = "menuId",description = "菜单ID")
    private String menuId;

    /**
     * 菜单父Id
     */
    @Schema(title = "pid",description = "菜单父Id")
    private String pid;

    /**
     * 菜单标题
     */
    @NotBlank(message = "菜单标题不能为空")
    @Size(max = 64,message = "菜单标题长度为1到64个字符")
    @Schema(title = "menuTitle",description = "菜单标题")
    private String menuTitle;

    /**
     * 菜单名称
     */
    @Size(max = 64,message = "菜单名称长度为1到64个字符")
    @Pattern(message = "菜单名称不能包含中文且仅以英文开头",regexp = "^$|(^[a-zA-Z][^\\u4e00-\\u9fa5]+$)")
    @Schema(title = "menuName",description = "菜单名称")
    private String menuName;

    /**
     * 权限标识
     */
    @NotBlank(message = "权限标识不能为空")
    @Size(max = 64,message = "权限标识长度为1到64个字符")
    @Schema(title = "authFlag",description = "权限标识")
    private String authFlag;

    /**
     * 类型(1:菜单/2:目录/3:按钮)
     */
    @Range(message = "类型超出范围",min = 1,max = 3)
    @NotNull(message = "类型不能为空")
    @Schema(title = "type",description = "类型(1:菜单/2:目录/3:按钮)")
    private Short type;

    /**
     * 文件路径
     */
    @Size(max = 255,message = "文件路径长度为1到255个字符")
    @Schema(title = "filePath",description = "文件路径")
    private String filePath;

    /**
     * 请求路径
     */
    @Size(max = 255,message = "请求路径长度为1到255个字符")
    @Schema(title = "requestPath",description = "请求路径")
    private String requestPath;

    /**
     * 是否启用(1:是/2:否)
     */
    @Range(message = "是否启用超出范围",min = 1,max = 2)
    @Schema(title = "enabled",description = "是否启用(1:是/2:否)")
    private Short enabled;

    /**
     * 菜单类型(1:页面/2:外链/3:内嵌)
     */
    @Range(message = "菜单类型超出范围",min = 1,max = 3)
    @Schema(title = "menuType",description = "菜单类型(1:页面/2:外链/3:内嵌)")
    private Short menuType;

    /**
     * 菜单图标
     */
    @Size(max = 64,message = "菜单图标长度为1到255个字符")
    @Schema(title = "icon",description = "菜单图标")
    private String icon;

    /**
     * 是否隐藏(1:是/2:否)
     */
    @Range(message = "是否隐藏超出范围",min = 1,max = 2)
    @Schema(title = "hidden",description = "是否隐藏(1:是/2:否)")
    private Short hidden;

    /**
     * 是否固定(1:是/2:否)
     */
    @Range(message = "是否固定超出范围",min = 1,max = 2)
    @Schema(title = "是否固定菜单tab",description = "是否固定菜单tab(1:是/2:否)")
    private Short affix;

    /**
     * 菜单参数
     */
    @Size(max = 255,message = "菜单参数长度为1到255个字符")
    @Schema(title = "params",description = "菜单参数")
    private String params;

    /**
     * 顺序
     */
    @Schema(title = "orderNum",description = "顺序")
    private Integer orderNum;

}
